package com.ag.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbPermission entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_PERMISSION", schema = "dbo", catalog = "AGDB")
public class TbPermission implements java.io.Serializable {

	// Fields

	private String PId;
	private String PName;
	private String PResource;
	private String PAction;
	private String a;
	private String b;
	private String c;
	private Set<TbRolePermission> tbRolePermissions = new HashSet<TbRolePermission>(
			0);

	// Constructors

	/** default constructor */
	public TbPermission() {
	}

	/** minimal constructor */
	public TbPermission(String PId, String PName, String PResource,
			String PAction) {
		this.PId = PId;
		this.PName = PName;
		this.PResource = PResource;
		this.PAction = PAction;
	}

	/** full constructor */
	public TbPermission(String PId, String PName, String PResource,
			String PAction, String a, String b, String c,
			Set<TbRolePermission> tbRolePermissions) {
		this.PId = PId;
		this.PName = PName;
		this.PResource = PResource;
		this.PAction = PAction;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbRolePermissions = tbRolePermissions;
	}

	// Property accessors
	@Id
	@Column(name = "P_ID", unique = true, nullable = false, length = 4)
	public String getPId() {
		return this.PId;
	}

	public void setPId(String PId) {
		this.PId = PId;
	}

	@Column(name = "P_NAME", nullable = false, length = 30)
	public String getPName() {
		return this.PName;
	}

	public void setPName(String PName) {
		this.PName = PName;
	}

	@Column(name = "P_RESOURCE", nullable = false, length = 90)
	public String getPResource() {
		return this.PResource;
	}

	public void setPResource(String PResource) {
		this.PResource = PResource;
	}

	@Column(name = "P_ACTION", nullable = false, length = 30)
	public String getPAction() {
		return this.PAction;
	}

	public void setPAction(String PAction) {
		this.PAction = PAction;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbPermission")
	public Set<TbRolePermission> getTbRolePermissions() {
		return this.tbRolePermissions;
	}

	public void setTbRolePermissions(Set<TbRolePermission> tbRolePermissions) {
		this.tbRolePermissions = tbRolePermissions;
	}

}